import { http } from "@/plugin/http";

export const login = async (params: API.Auth.LoginParams) => {
  try {
    return await http.post<API.Auth.LoginResponse>("/auth/login", params);
  } catch (error) {
    return null;
  }
};

export const register = async (params: API.Auth.RegisterParams) => {
  try {
    return await http.post<API.Auth.LoginResponse>("/auth/register", params);
  } catch (error) {
    return null;
  }
};

export const facebookLogin = async () => {
  try {
    return await http.get<API.Auth.OtherLoginResponse>("/auth/facebook/login");
  } catch (error) {
    return null;
  }
};

export const xLogin = async () => {
  try {
    return await http.get<API.Auth.OtherLoginResponse>("/auth/x/login");
  } catch (error) {
    return null;
  }
};

export const googleLogin = async () => {
  try {
    return await http.get<API.Auth.OtherLoginResponse>("/auth/google/login");
  } catch (error) {
    return null;
  }
};
